<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./adminTemplate.xhtml">

            <ui:define name="title">
                Approve Driver
            </ui:define>

            <ui:define name="contain">
                <h:form> 
                    <h2 class="ico_mug">Request from Driver</h2>                                                             
                        <p:dataTable var="dr" value="#{requestController.listDr}"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="10,15,20" paginator="true" rows="10">                               
                            <p:column>  
                                <f:facet name="header">  
                                        Name Driver  
                                </f:facet>  
                                <h:outputText value="#{dr.name}" />  
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        ContactPerson  
                                </f:facet>  
                                <h:outputText value="#{dr.contactPerson}"/>
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        Address  
                                </f:facet>  
                                <h:outputText value="#{dr.address}" />  
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        City  
                                </f:facet>  
                                <h:outputText value="#{dr.city}"/>
                            </p:column>
                            <p:column>  
                                <f:facet name="header">  
                                        Mobile 
                                </f:facet>  
                                <h:outputText value="#{dr.mobile}" />  
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        Telephone
                                </f:facet>  
                                <h:outputText value="#{dr.telephone}" />  
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        Experience  
                                </f:facet>  
                                <h:outputText value="#{dr.experience}" />  
                            </p:column> 
                            <p:column>  
                                <f:facet name="header">  
                                        Description  
                                </f:facet>  
                                <h:outputText value="#{dr.description}" />  
                            </p:column> 
                            <p:column style="text-align: center">  
                                <f:facet name="header">  
                                        Approve  
                                </f:facet>  
                                <h:commandLink actionListener="#{requestController.updateAcceptDr(dr.id)}">
                                    <img src="img/accept.jpg" alt="accepted"/>
                                </h:commandLink>
                                <h:commandLink actionListener="#{requestController.updateDenyDr(dr.id)}">
                                    <img src="img/denied.png" alt="denied"/>
                                </h:commandLink>                                
                            </p:column> 
                        </p:dataTable>                                                                
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
